﻿<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

	<!-- required to display the correct page - do not modify -->
	<xsl:param name="guid" />
	<xsl:param name="currentUrl" />
	<!-- end required params -->

	<!-- 
	Set this to 1 if you want the navigation template to be displayed 
	The navigation will be generated from your website site map
	-->
	<xsl:param name="showNavigation" select="1" /> 

	<xsl:template name="style">
		<![CDATA[
<style>
	/* 
	Add your style information here 
	*/
	body
	{
	}
	/* End style information */
</style>
		]]>
	</xsl:template>
	
	<xsl:template match="/">
<html>
<head>
	<title><!-- Replace this comment with the title of your website --></title>
	<xsl:call-template name="style" />
</head>
<body>

<!-- If you have set the showNavigation parameter = 1 the navigation will be output here -->
<xsl:if test="$showNavigation=1 and /website/navigation">
<div id="navigation">
	<xsl:apply-templates select="/website/navigation"></xsl:apply-templates>
</div>
</xsl:if>
<!-- End navigation -->
	
	
<!-- Header can go here -->
<div id="header">
	
</div>

<!-- 
The web page content is inserted here 
-->
<div id="content">
<xsl:value-of select="/website/webpage[($guid='' and @homepage='1') or ($guid=@guid)]/node()"/>
</div>
<!-- 
End web page content 
-->
	
<!-- Footer can go here -->
<div id="footer">
	
</div>

<!-- 
If you have set up a Google Analytics or other visitor tracking add the script here
(This can be set up for you - contact inquiries@tanash.net for more information)
-->

	
</body>
</html>







<!--
	End of website template
	
	Do not modify below this point or you risk breaking your website!
	-->
	
	
</div>
	</xsl:template>

	<!-- 
		Navigation generation
		No need to mess with this
		Style your navigation using the stylesheet at the top of this template
	-->
	<xsl:template match="/website/navigation">
			<xsl:element name="li">
				<xsl:element name="h2">
					<xsl:element name="a">
						<xsl:attribute name="class">
							root<xsl:if test="string($currentUrl)=string(@navigateURL)"> selected</xsl:if>
						</xsl:attribute>
						<xsl:attribute name="href">
							<xsl:value-of select="@navigateURL"/>
						</xsl:attribute>
						<xsl:value-of select="text()"/>
					</xsl:element>
					<xsl:if test="./navigation/node()">
						<xsl:element name="ul">
							<xsl:apply-templates select="./navigation">
							</xsl:apply-templates>
						</xsl:element>
					</xsl:if>
				</xsl:element>
			</xsl:element>
	</xsl:template>

	<xsl:template match="navigation" name="menuBranch">
		<xsl:element name="li">
			<xsl:element name="a">
				<xsl:if test="string($currentUrl)=string(@navigateURL)">
					<xsl:attribute name="class">selected</xsl:attribute>
				</xsl:if>
				<xsl:attribute name="href">
					<xsl:value-of select="@navigateURL"/>
				</xsl:attribute>
				<xsl:value-of select="text()"/>
			</xsl:element>
			<xsl:if test="./navigation/node()">
				<xsl:element name="ul">
					<xsl:apply-templates select="./navigation">
					</xsl:apply-templates>
				</xsl:element>
			</xsl:if>
		</xsl:element>
	</xsl:template>
	<!-- end navigation structure -->
	
</xsl:stylesheet> 

